Skip to content

Fix pyinfo for Python 3.12 changes #15103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2023
Merged

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

@github-actions

This comment has been minimized.

@hauntsaninja hauntsaninja marked this pull request as draft April 23, 2023 00:26
@hauntsaninja hauntsaninja marked this pull request as ready for review April 23, 2023 00:33
@@ -22,6 +19,10 @@

sys.path = old_sys_path

import os
import site
import sysconfig
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sysconfig now imports types, so we need to do the path hack sooner

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

from distutils.sysconfig import get_python_lib

res = [get_python_lib()]
res = [sysconfig.get_paths()["purelib"]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I don't recall, are purelib and sitepackages 1-to-1? I also don't recall if platdir is included in getsitepackages.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, I think what I have is equivalent to get_python_lib, but I think you're right that platlibdir is in getsitepackages

@hauntsaninja
Copy link
Collaborator Author

I'm going to merge this so it doesn't conflict with a good-first-issue that we'll do at the sprints, but I'll look into whether we should add platlibdir to this branch

@hauntsaninja hauntsaninja merged commit a2b0f18 into python:master Apr 24, 2023
@hauntsaninja hauntsaninja deleted the pyinfo branch April 24, 2023 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants